package com.power.sifa.respond.model;


import com.plf.core.common.annotations.FieldEnumText;
import com.plf.core.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
*  再审审理信息实体类
*/

@Entity
@ApiModel(value="再审审理信息")
@Data
@Table(name="Apl_retrial",schema="sfapprove")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@IdClass(Apl_retrial.Apl_retrialPK.class) 用于复合组件
public class Apl_retrial extends BaseModel implements Serializable {

	private static final long serialVersionUID = 1L;

    @Id
    @Setter(AccessLevel.NONE)
    @ApiModelProperty(value = "序号")
    private String id;

    @ApiModelProperty(value = "再审法院")
    private String court;

    @ApiModelProperty(value = "再审判决日期")
    private String judgdate;

    @ApiModelProperty(value = "再审审理结果")
    private Integer result;

    @ApiModelProperty(value = "再审案件编号")
    private String code;

    @ApiModelProperty(value = "负责人是否出庭")
    private Integer iscourt;

    @ApiModelProperty(value = "再审出庭类型")
    private Integer type;

    @ApiModelProperty(value = "再审法院类型")
    private Integer courttype;

    @ApiModelProperty(value = "再审申请人")
    private String applyname;

    @ApiModelProperty(value = "法院是否支持再审申请人请求")
    private Integer issupport;

    @ApiModelProperty(value = "裁定年份")
    private String ruleyear;

    @ApiModelProperty(value = "再审判决结果")
    private Integer againres;

    @ApiModelProperty(value = "其他说明")
    private String other;

    /**
     *  再审审理结果文本
     */
    @Transient
    @FieldEnumText(eum="Tp_review", valuefield="result")
    private String result_text;

    /**
     *  负责人是否出庭文本
     */
    @Transient
    @FieldEnumText(eum="yesNo", valuefield="iscourt")
    private String iscourt_text;

    /**
     *  再审出庭类型文本
     */
    @Transient
    @FieldEnumText(eum="", valuefield="type")
    private String type_text;

    /**
     *  再审法院类型文本
     */
    @Transient
    @FieldEnumText(eum="Tp_court", valuefield="courttype")
    private String courttype_text;

    /**
     *  法院是否支持再审申请人请求文本
     */
    @Transient
    @FieldEnumText(eum="yesNo", valuefield="issupport")
    private String issupport_text;

    /**
     *  再审判决结果文本
     */
    @Transient
    @FieldEnumText(eum="Tp_againres", valuefield="againres")
    private String againres_text;


    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("court", this.getCourt());
        map.put("judgdate", this.getJudgdate());
        map.put("result_text", this.result_text);
        map.put("result", this.getResult());
        map.put("code", this.getCode());
        map.put("iscourt_text", this.iscourt_text);
        map.put("iscourt", this.getIscourt());
        map.put("type_text", this.type_text);
        map.put("type", this.getType());
        map.put("courttype_text", this.courttype_text);
        map.put("courttype", this.getCourttype());
        map.put("applyname", this.getApplyname());
        map.put("issupport_text", this.issupport_text);
        map.put("issupport", this.getIssupport());
        map.put("ruleyear", this.getRuleyear());
        map.put("againres_text", this.againres_text);
        map.put("againres", this.getAgainres());
        map.put("other", this.getOther());
        return map;
    }

    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Apl_retrialPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String)key;

        //Apl_retrialPK pk = (Apl_retrialPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}
